#ifndef __BEGIN_SCENE_H__
#define __BEGIN_SCENE_H__

#include "cocos2d.h"
#include "../support/support.h"

enum Step {
    STEP_LOGO = 1,
    STEP_WARNING = 2,
    STEP_MAGIC = 3,
    STEP_FINAL = 4
};

struct StepStatus {
    Step step;
    float duration;
};

USING_NS_CC;

class Begin : public Layer {
public:
    // current step for showing
    StepStatus curStep;
    Layer* mainLayer;
    
    // there's no 'id' in cpp, so we recommend returning the class instance pointer
    static Scene* createScene();

    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
    virtual bool init();
    
    // implement the "static create()" method manually
    CREATE_FUNC(Begin);
    
    void onExit() override;
    
    void initStep(Step step);
    
    void doStep(Step step);
    
    void update(float dt) override;
    
    void updateStep(float dt);
};

#endif // __BEGIN_SCENE_H__
